import { BroadCastCall } from "../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../Framework/MQ/MessageBlock";
import { SPetSire } from "../../../../Message/Public/SPetSire";
import { EPetSireOperation } from "../../../../Message/Public/EPetSireOperation";
import { NetDispatcher } from "../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../mvc/ServerCommand";
//class PetSireCommand
    
    export  class PetSireCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            super.call(arg1);
            var loc1=arg1.messageBase as SPetSire;
            _cache.pet.petSire = loc1;
            var loc2=loc1.oper.__value;
            switch (loc2) 
            {
                case EPetSireOperation._EPetSireOperAgree:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperAgree, loc1);
                    break;
                }
                case EPetSireOperation._EPetSireOperUpdatePet:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperUpdatePet, loc1);
                    break;
                }
                case EPetSireOperation._EPetSireOperLock:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperLock, loc1);
                    break;
                }
                case EPetSireOperation._EPetSireOperConfirm:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperConfirm, loc1);
                    break;
                }
                case EPetSireOperation._EPetSireOperCancel:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperCancel, loc1);
                    break;
                }
                case EPetSireOperation._EPetSireOperEnd:
                {
                    NetDispatcher.dispatchCmd(ServerCommand.PetSire_OperEnd, loc1);
                    break;
                }
            }
            return;
        }
    }
